1. Field of the Invention
The present invention relates to a data encipherment apparatus and an illegal alteration prevention system for preventing alteration of computer software or data by an illegal user who tries to illegally use the software or data (illegal copying and so forth).
2. Description of the Related Art
A technique for preventing illegal copying of computer software is known and disclosed, for example, in Japanese Patent Laid-Open No. Hei 9-231137 entitled xe2x80x9cDuplication Discrimination Method and Reading Out Apparatusxe2x80x9d. According to the apparatus, key codes having a particular error rate K are recorded on part of a CD-ROM (compact disk read only memory). The error rate K is selected to a value with which complete correction is impossible by an error correction coding-decoding apparatus provided in a reading out apparatus for a CD-ROM. If the CD-ROM is duplicated illegally, then the error rate of key codes varies. The apparatus described above makes use of the phenomenon just described to discriminate whether or not a CD-ROM loaded in the apparatus is an illegally duplicated CD-ROM and disables the reading out apparatus when the loaded CD-ROM is an illegally duplicated CD-ROM.
As an illegal copying prevention technique of a similar type, a system is widely known wherein simple hardware having a particular key is added to the system and, upon execution of a program, it is discriminated whether or not the key has a normal value and execution of the program is permitted only when the key has the normal value.
The prior art apparatus and system described above have the following problems.
The first problem resides in that it is difficult to analyze program codes and investigate by what mechanism illegal copying is discriminated. The reason is that illegal utilization of a program can be performed by analyzing the program codes using an analysis tool such as a disassembler tool and altering the program based on a result of the analysis.
The second problem resides in that, if program codes are altered, then execution of copying onto a medium cannot be prevented. The reason is that, if program codes of a program portion used for discrimination of a copied medium are altered such that they normally indicate that the medium is an original medium even if it is a copied medium, then execution of the software with the copied medium cannot be prevented. A similar problem is likely to occur not only with programs but also with data.
It is an object of the present invention to provide an encipherment apparatus and an illegal alteration prevention system which can prevent an attempt of alteration to and illegal use of data such as program codes by an illegal user.
In order to attaint the object described above, according to an aspect of the present invention, there is provided a data encipherment apparatus, comprising means for dividing data into first to n+1th blocks, n being an integer equal to or greater than 1, cryptographic key production means for successively producing first to nth cryptographic keys based on the data of the first to nth blocks, respectively, encipherment means for successively enciphering the second to n+1th blocks with the first to nth cryptographic keys, respectively, and outputting means for successively outputting the first block and the enciphered second to n+1th blocks.
The outputting means may encipher the first block based on a 0th cryptographic key determined in advance and output the enciphered first block.
According to another aspect of the present invention, there is provided an illegal alteration prevention system for data, comprising a data processing apparatus, a file apparatus, and an encipherment apparatus for producing data to be written into the file apparatus, the encipherment apparatus including means for dividing data into first to n+1th blocks, n being an integer equal to or greater than 1, cryptographic key production means for successively producing first to nth cryptographic keys based on the data of the first to nth blocks, respectively, encipherment means for successively enciphering the second to n+1th blocks with the first to nth cryptographic keys, respectively, and outputting means for successively outputting the first block and the enciphered second to n+1th blocks.
According to a further aspect of the present invention, there is provided an illegal alteration prevention system for data, comprising a data processing apparatus, a file apparatus including a first storage area for storing a top block of data and a second storage area for storing n blocks of the data following the top block, n being an integer equal to or greater than 1, and an encipherment apparatus for producing data to be written into the file apparatus, the encipherment apparatus being operable to produce a first cryptographic key based on the data of the first storage area, encipher a first one of the n blocks with the first cryptographic key, successively produce ith cryptographic keys based on the data of the ixe2x88x921th ones of the n blocks and successively encipher the ith blocks with the ith cryptographic keys, i being equal to or greater than 2 but equal to or smaller than n, the data processing apparatus including first reading out means for reading out the data of the first storage area, second reading out means for successively reading out the data of the second storage area, decipherment means for successively deciphering the ith blocks successively read out by the second reading out means with the ith cryptographic keys successively supplied thereto, and cryptographic key calculation means for producing the first cryptographic key based on the output of the first reading out means, supplying the first cryptographic key to the decipherment means, successively producing the ith cryptographic keys based on the deciphered outputs of the ixe2x88x921th blocks from the decipherment means and successively supplying the ith cryptographic keys to the decipherment means.
The illegal alteration prevention system for data may be constructed such that the first storage area has stored therein the top block of the data which have been enciphered with the 0th cryptographic key determined in advance, and the first reading out means deciphers the data stored in the first storage area with the 0th cryptographic key and outputs the deciphered data.
The cryptographic key calculation means may use a one-way function to produce the first to nth cryptographic keys.
In the data encipherment apparatus and the illegal alteration prevention system, since most of program codes are enciphered, it itself is difficult to analyze the program codes using an analysis tool such as a disassembler tool. Further, since a one-way function of program codes being executed at present is calculated as a decipherment key by the cryptographic key calculation means and is used for decipherment of program codes to be executed next, it is difficult to alter and illegally use the program codes.
The above and other objects, features and advantages of the present invention will become apparent from the following description and the appended claims, taken in conjunction with the accompanying drawings in which like parts or elements are denoted by like reference symbols.